/*
*Copyright 2021-2023 NERCIS
*
*Licensed under the Apache License, Version 2.0 (the "License");
*you may not use this file except in compliance with the License.
*You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*Unless required by applicable law or agreed to in writing, software
*distributed under the License is distributed on an "AS IS" BASIS,
*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*See the License for the specific language governing permissions and
*limitations under the License.
*/

package cn.ac.nercis.pes.community.mapper.evaluation;

import cn.ac.nercis.pes.common.utils.ConvertUtils;
import cn.ac.nercis.pes.community.model.vo.evaluation.EvaluationStageVO;
import cn.ac.nercis.pes.community.model.vo.evaluation.EvaluatorVO;
import cn.ac.nercis.pes.model.dto.evaluation.prepare.EvaluationStageDTO;
import cn.ac.nercis.pes.model.dto.evaluation.prepare.EvaluatorDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 * 测评过程相关信息类型映射
 *
 * @author zpy
 * @version 1.0.0
 */
@Mapper(componentModel = "spring",
        imports = {ConvertUtils.class},
        unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface EvaluationProcessViewMapper {
    EvaluationProcessViewMapper INSTANCE = Mappers.getMapper(EvaluationProcessViewMapper.class);

    EvaluatorVO toEvaluatorVO(EvaluatorDTO dto);
    EvaluatorDTO toEvaluatorDTO(EvaluatorVO vo);

    @Mapping(target = "preparationPlan.projectStart",source = "projectStart")
    @Mapping(target = "preparationPlan.collectAnalyze",source = "collectAnalyze")
    @Mapping(target = "preparationPlan.toolPrepare",source = "toolPrepare")
    @Mapping(target = "preparationPlan.projectStartCycle",source = "projectStartCycle")
    @Mapping(target = "preparationPlan.collectAnalyzeCycle",source = "collectAnalyzeCycle")
    @Mapping(target = "preparationPlan.toolPrepareCycle",source = "toolPrepareCycle")
    @Mapping(target = "compilationPlan.assetDefine",source = "assetDefine")
    @Mapping(target = "compilationPlan.targetDefine",source = "targetDefine")
    @Mapping(target = "compilationPlan.checkPointDefine",source = "checkPointDefine")
    @Mapping(target = "compilationPlan.contentDefine",source = "contentDefine")
    @Mapping(target = "compilationPlan.schemeMake",source = "schemeMake")
    @Mapping(target = "compilationPlan.assetDefineCycle",source = "assetDefineCycle")
    @Mapping(target = "compilationPlan.targetDefineCycle",source = "targetDefineCycle")
    @Mapping(target = "compilationPlan.contentDefineCycle",source = "contentDefineCycle")
    @Mapping(target = "compilationPlan.schemeMakeCycle",source = "schemeMakeCycle")
    @Mapping(target = "evaluationPlan.implementPrepare",source = "implementPrepare")
    @Mapping(target = "evaluationPlan.sceneRecord",source = "sceneRecord")
    @Mapping(target = "evaluationPlan.resultDefine",source = "resultDefine")
    @Mapping(target = "evaluationPlan.implementPrepareCycle",source = "implementPrepareCycle")
    @Mapping(target = "evaluationPlan.sceneRecordCycle",source = "sceneRecordCycle")
    @Mapping(target = "evaluationPlan.resultDefineCycle",source = "resultDefineCycle")
    @Mapping(target = "analysisPlan.unitEval",source = "unitEval")
    @Mapping(target = "analysisPlan.overallEval",source = "overallEval")
    @Mapping(target = "analysisPlan.quantifyEval",source = "quantifyEval")
    @Mapping(target = "analysisPlan.riskAnalyze",source = "riskAnalyze")
    @Mapping(target = "analysisPlan.evalConclusion",source = "evalConclusion")
    @Mapping(target = "analysisPlan.secretReport",source = "secretReport")
    @Mapping(target = "analysisPlan.unitEvalCycle",source = "unitEvalCycle")
    @Mapping(target = "analysisPlan.overallEvalCycle",source = "overallEvalCycle")
    @Mapping(target = "analysisPlan.quantifyEvalCycle",source = "quantifyEvalCycle")
    @Mapping(target = "analysisPlan.riskAnalyzeCycle",source = "riskAnalyzeCycle")
    @Mapping(target = "analysisPlan.evalConclusionCycle",source = "evalConclusionCycle")
    @Mapping(target = "analysisPlan.secretReportCycle",source = "secretReportCycle")
    EvaluationStageDTO toEvaluationStageDTO(EvaluationStageVO vo);

}